package com.wise.site.protocol.result;

import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.wise.site.protocol.base.SoapItem;
import com.wise.site.protocol.base.SoapResult;

public class ShopItemsResult extends SoapResult {
	public List<ShopItem> list;

	@Override
	public void parseData(String response) throws Exception {
		JSONObject json = new JSONObject(response);
		if(json.getInt("flag") == 1){
			JSONArray array = new JSONArray(json.getString("msg"));
			list = new ArrayList<ShopItem> ();
			ShopItem item = null;
			for(int i = 0; i < array.length(); i++){
				item = new ShopItem(array.getJSONObject(i));
				list.add(item);
			}
		}
	}
}
